// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_k;

import android.os.FileObserver;
import com.nnee.p_c.cls_o;
import com.nnee.p_pr.p_a.cls_f;
import com.nnee.p_pr.p_b.cls_a;
import java.io.File;
import java.util.concurrent.atomic.AtomicLong;

// Referenced classes of package com.nnee.k:
//            a, b

public class cls_e extends  FileObserver
{

    public cls_e(String s, long l1, boolean flag, long l2, com.nnee.p_k.cls_a a1)
    {
        super(s, 4040);
        k = s;
        l = l1;
        o = l2;
        p = flag;
        a = a1;
        File file = new File(s);
        m = new AtomicLong(0L);
        if(file.exists())
            com.nnee.p_c.cls_o.a(file, file.list(), this);
    }

    static String a(cls_e e1)
    {
        return e1.k;
    }

    private void a(cls_b b1)
    {
        File file = new File(k);
        String as[] = file.list();
        m.set(0L);
        com.nnee.p_c.cls_o.a(file, as, this);
        if(b == b1)
            b = null;
    }

    static void a(cls_e e1, cls_b b1)
    {
        e1.a(b1);
    }

    static AtomicLong b(cls_e e1)
    {
        return e1.m;
    }

    static long c(cls_e e1)
    {
        return e1.l;
    }

    private void f()
    {
    }

    private void g()
    {
        if(p && m.get() >= l && !c())
            d();
    }

    private void h()
    {
        if(o > 0L && m.get() >= o && a != null)
            o = a.a(k, m.get(), o);
    }

    public void a()
    {
        m.set(0L);
        com.nnee.p_pr.p_b.cls_a.a(k, 0L);
    }

    public void a(int i1, long l1)
    {
        m.addAndGet(l1);
        g();
        h();
        f();
    }

    public void a(long l1)
    {
        o = l1;
    }

    public void a(long l1, boolean flag)
    {
        if(!n && p)
        {
            if(c())
                e();
            b = new cls_b(this, l1, flag);
            Thread thread = new Thread(b);
            thread.setPriority(1);
            thread.start();
        }
    }

    public void a(File file)
    {
        if(file.exists())
        {
            m.addAndGet(file.length());
            g();
            f();
            h();
        }
    }

    public void a(String s)
    {
        b(new File(k, s));
    }

    public void a(boolean flag)
    {
        n = flag;
        if(flag && c())
            e();
    }

    public boolean a(File file, File file1)
    {
        boolean flag;
        if(file.exists())
        {
            m.addAndGet(-file.length());
            flag = file.renameTo(file1);
        } else
        {
            flag = false;
        }
        return flag;
    }

    public long b()
    {
        long l1;
        if((new File(k)).exists())
            l1 = m.get();
        else
            l1 = 0L;
        return l1;
    }

    public boolean b(File file)
    {
        boolean flag;
        if(file.exists())
        {
            m.addAndGet(-file.length());
            if(file.isDirectory())
                flag = com.nnee.p_pr.p_a.cls_f.c(file);
            else
                flag = file.delete();
        } else
        {
            flag = false;
        }
        return flag;
    }

    public void c(File file)
    {
        m.addAndGet(-file.length());
    }

    public boolean c()
    {
        boolean flag;
        if(b != null)
            flag = true;
        else
            flag = false;
        return flag;
    }

    public void d()
    {
        a(0x14997000L, false);
    }

    public void e()
    {
        cls_b b1 = b;
        if(b1 != null)
            b1.a();
    }

    public void onEvent(int i1, String s)
    {
    }

    private static final boolean c = false;
    private static final String d = "FileSizeObserver";
    private static final int e = 4040;
    private static final int f = 0x14997000;
    private static final int g = 0x36ee80;
    private static final int h = 15000;
    private static final int i = 25;
    private static final int j = 13;
    com.nnee.p_k.cls_a a;
    cls_b b;
    private String k;
    private long l;
    private AtomicLong m;
    private boolean n;
    private long o;
    private boolean p;
}
